package com.xiaohua.api.service.impl;

import java.util.List;
import com.xiaohua.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xiaohua.api.mapper.XhApiCredentialsMapper;
import com.xiaohua.api.domain.XhApiCredentials;
import com.xiaohua.api.service.IXhApiCredentialsService;

/**
 * API凭证管理Service业务层处理
 * 
 * @author 小花
 * @date 2025-03-27
 */
@Service
public class XhApiCredentialsServiceImpl implements IXhApiCredentialsService 
{
    @Autowired
    private XhApiCredentialsMapper xhApiCredentialsMapper;

    /**
     * 查询API凭证管理
     * 
     * @param id API凭证管理主键
     * @return API凭证管理
     */
    @Override
    public XhApiCredentials selectXhApiCredentialsById(Long id)
    {
        return xhApiCredentialsMapper.selectXhApiCredentialsById(id);
    }

    /**
     * 查询API凭证管理列表
     * 
     * @param xhApiCredentials API凭证管理
     * @return API凭证管理
     */
    @Override
    public List<XhApiCredentials> selectXhApiCredentialsList(XhApiCredentials xhApiCredentials)
    {
        return xhApiCredentialsMapper.selectXhApiCredentialsList(xhApiCredentials);
    }

    /**
     * 新增API凭证管理
     * 
     * @param xhApiCredentials API凭证管理
     * @return 结果
     */
    @Override
    public int insertXhApiCredentials(XhApiCredentials xhApiCredentials)
    {
        xhApiCredentials.setCreateTime(DateUtils.getNowDate());
        return xhApiCredentialsMapper.insertXhApiCredentials(xhApiCredentials);
    }

    /**
     * 修改API凭证管理
     * 
     * @param xhApiCredentials API凭证管理
     * @return 结果
     */
    @Override
    public int updateXhApiCredentials(XhApiCredentials xhApiCredentials)
    {
        xhApiCredentials.setUpdateTime(DateUtils.getNowDate());
        return xhApiCredentialsMapper.updateXhApiCredentials(xhApiCredentials);
    }

    /**
     * 批量删除API凭证管理
     * 
     * @param ids 需要删除的API凭证管理主键
     * @return 结果
     */
    @Override
    public int deleteXhApiCredentialsByIds(Long[] ids)
    {
        return xhApiCredentialsMapper.deleteXhApiCredentialsByIds(ids);
    }

    /**
     * 删除API凭证管理信息
     * 
     * @param id API凭证管理主键
     * @return 结果
     */
    @Override
    public int deleteXhApiCredentialsById(Long id)
    {
        return xhApiCredentialsMapper.deleteXhApiCredentialsById(id);
    }
}
